<script setup lang="ts">
import { ref, onMounted, computed } from 'vue';
import { useDictStore } from '@/store/dict';

interface Dictionary {
   [key: string]: string | number | undefined;
}
const props = defineProps({
   dictKey: {
      // 字典键
      type: String,
      required: true,
   },
   locale: {
      // 语言环境
      type: String,
      required: false,
      default: 'en',
   },
});

const dictStore = useDictStore();

const translateValue = computed(() => {
   return dictStore.getDict(props.dictKey);
});

// onMounted(() => {
//    dictData.value = dictStore.getDict(props.dictKey);
// });
</script>

<template>
   <span>{{ translateValue }}</span>
</template>

<style lang="scss" scoped></style>
